import Taro from '@tarojs/taro'

export const getJson = (url, data) => {
  Taro.showLoading()
  return Taro.request({url, data, method: 'GET'}).then(res => {
    Taro.hideLoading()
    return res;
  })
}
export const postJson = (url, data) => {
  Taro.showLoading()
  return Taro.request({url, header: {
    'content-type': 'application/json'
   }, data, method: 'POST',}).then(res => {
    Taro.hideLoading()
    return res;
  })
}
